﻿
window.onload = function(){
	playit();
 }
 
var currslid = 0;
var slidint;
var picarry = {};
var lnkarry = {};
var ttlarry = {};
var t=document.getElementById("pictable");
var num=t.rows.length;
for(var i=0;i<num;i++){
  try{
	  picarry[i]=t.rows[i].cells[0].childNodes[0].src;
	  ttlarry[i]=t.rows[i].cells[1].innerHTML;
	  lnkarry[i]=t.rows[i].cells[2].innerHTML; 
   }
	catch(e){
  }
}
 
function playit(){
	slidint = setTimeout(playnext,2500);
 }
 
function playnext(){
	if(currslid==6){
		currslid = 0;
	}
	else{
		currslid++;
	};
	setfoc(currslid);
	playit();
} 

function setfoc(id){
  document.getElementById("bigimg").src = picarry[id];
  document.getElementById("a_jimg").href = lnkarry[id];
  if (id==4) {
	  document.getElementById("a_jimg").style.background = 'url('+picarry[0]+')'	
	}
  else {
	  document.getElementById("a_jimg").style.background = 'url('+picarry[id+1]+')'
	}
  currslid = id;
  for(i=0;i<7;i++){
	  document.getElementById("li_jimg"+i).className = "li_jimg";
  };
  document.getElementById("li_jimg"+id).className ="li_jimg on";

  var borserInfo=navigator.userAgent.toLowerCase();  //判断当前用户所使用浏览器的类型
  if(/msie/.test(borserInfo))
  {
	document.getElementById("bigimg").style.visibility = "hidden";
	document.getElementById("bigimg").filters[0].Apply();
	document.getElementById("bigimg").filters[0].transition=23;
	if (document.getElementById("bigimg").style.visibility == "visible") {
	  document.getElementById("bigimg").style.visibility = "hidden";
	}
	else {
	  document.getElementById("bigimg").style.visibility = "visible";
	}
	document.getElementById("bigimg").filters[0].Play();
  }
  stopit();
 }

function stopit(){
	clearTimeout(slidint);
 }




	